/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * DialogoValoresMetodologia.java
 *
 * Created on 01-12-2009, 02:56:37 AM
 */
package dialogos;

import utilidades.ValoresMetodologiaEstimacion;
import vistas.VistaPrincipal;

/**
 *
 * @author Mauricio
 */
public class DialogoValoresMetodologia extends javax.swing.JDialog {

	ValoresMetodologiaEstimacion vme = new ValoresMetodologiaEstimacion ();

	/** Creates new form DialogoValoresMetodologia */
	public DialogoValoresMetodologia (java.awt.Frame parent, boolean modal) {
		super (parent, modal);
		initComponents ();
		this.setLocationRelativeTo (null);
		cargarValoresMetodologia ();
	}

	/** This method is called from within the constructor to
	 * initialize the form.
	 * WARNING: Do NOT modify this code. The content of this method is
	 * always regenerated by the Form Editor.
	 */
	@SuppressWarnings ("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanelDialogoModificarValoresMetodologia = new javax.swing.JPanel();
        jPanel2 = new javax.swing.JPanel();
        jLabel2 = new javax.swing.JLabel();
        jLabel1 = new javax.swing.JLabel();
        jTextFieldHorasSoftwarePequeño = new javax.swing.JTextField();
        jTextFieldHorasSoftwareMediano = new javax.swing.JTextField();
        jPanel3 = new javax.swing.JPanel();
        jLabel5 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        jTextFieldHorasModalidadUsuario = new javax.swing.JTextField();
        jTextFieldHorasModalidadLugarEvaluacion = new javax.swing.JTextField();
        jPanel4 = new javax.swing.JPanel();
        jLabel6 = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();
        jLabel8 = new javax.swing.JLabel();
        jTextFieldPorcentajePeriodoEntregaSoftwarePequeño = new javax.swing.JTextField();
        jTextFieldPorcentajePeriodoEntregaSoftwareGrande = new javax.swing.JTextField();
        jTextFieldPorcentajePeriodoEntregaSoftwareMediano = new javax.swing.JTextField();
        jButtonAceptar = new javax.swing.JButton();
        jButtonCancelar = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setTitle("REUSA - Modificar valores metodología");

        jPanelDialogoModificarValoresMetodologia.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(), "Modificar Valores Metodología", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 1, 12))); // NOI18N

        jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(), "Horas"));

        jLabel2.setText("Software mediano:");

        jLabel1.setText("Software pequeño:");

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel1)
                    .addComponent(jLabel2))
                .addGap(45, 45, 45)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jTextFieldHorasSoftwareMediano, javax.swing.GroupLayout.PREFERRED_SIZE, 101, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jTextFieldHorasSoftwarePequeño, javax.swing.GroupLayout.PREFERRED_SIZE, 102, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(54, 54, 54))
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel1)
                    .addComponent(jTextFieldHorasSoftwarePequeño, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel2)
                    .addComponent(jTextFieldHorasSoftwareMediano, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(), "Aumento Horas por Modalidad"));

        jLabel5.setText("Lugar de evaluación:");

        jLabel4.setText("Usuarios:");

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel4)
                    .addComponent(jLabel5))
                .addGap(41, 41, 41)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(jTextFieldHorasModalidadUsuario)
                    .addComponent(jTextFieldHorasModalidadLugarEvaluacion, javax.swing.GroupLayout.DEFAULT_SIZE, 100, Short.MAX_VALUE))
                .addGap(53, 53, 53))
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel4)
                    .addComponent(jTextFieldHorasModalidadUsuario, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel5)
                    .addComponent(jTextFieldHorasModalidadLugarEvaluacion, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(12, Short.MAX_VALUE))
        );

        jPanel4.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(), "Porcentaje por Período de Entrega Veloz"));

        jLabel6.setText("Caso software pequeño:");

        jLabel7.setText("Caso software mediano:");

        jLabel8.setText("Caso software grande:");

        javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
        jPanel4.setLayout(jPanel4Layout);
        jPanel4Layout.setHorizontalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel6)
                    .addComponent(jLabel8)
                    .addComponent(jLabel7))
                .addGap(23, 23, 23)
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jTextFieldPorcentajePeriodoEntregaSoftwareGrande, javax.swing.GroupLayout.PREFERRED_SIZE, 102, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                        .addComponent(jTextFieldPorcentajePeriodoEntregaSoftwareMediano, javax.swing.GroupLayout.Alignment.LEADING)
                        .addComponent(jTextFieldPorcentajePeriodoEntregaSoftwarePequeño, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 100, Short.MAX_VALUE)))
                .addGap(50, 50, 50))
        );
        jPanel4Layout.setVerticalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel6)
                    .addComponent(jTextFieldPorcentajePeriodoEntregaSoftwarePequeño, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel7)
                    .addComponent(jTextFieldPorcentajePeriodoEntregaSoftwareMediano, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel8)
                    .addComponent(jTextFieldPorcentajePeriodoEntregaSoftwareGrande, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(28, Short.MAX_VALUE))
        );

        jButtonAceptar.setText("Aceptar");
        jButtonAceptar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonAceptarActionPerformed(evt);
            }
        });

        jButtonCancelar.setText("Cancelar");
        jButtonCancelar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonCancelarActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanelDialogoModificarValoresMetodologiaLayout = new javax.swing.GroupLayout(jPanelDialogoModificarValoresMetodologia);
        jPanelDialogoModificarValoresMetodologia.setLayout(jPanelDialogoModificarValoresMetodologiaLayout);
        jPanelDialogoModificarValoresMetodologiaLayout.setHorizontalGroup(
            jPanelDialogoModificarValoresMetodologiaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelDialogoModificarValoresMetodologiaLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanelDialogoModificarValoresMetodologiaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanelDialogoModificarValoresMetodologiaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(jPanelDialogoModificarValoresMetodologiaLayout.createSequentialGroup()
                            .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, 316, Short.MAX_VALUE)
                            .addContainerGap())
                        .addGroup(jPanelDialogoModificarValoresMetodologiaLayout.createSequentialGroup()
                            .addComponent(jPanel4, javax.swing.GroupLayout.DEFAULT_SIZE, 316, Short.MAX_VALUE)
                            .addContainerGap())
                        .addGroup(jPanelDialogoModificarValoresMetodologiaLayout.createSequentialGroup()
                            .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, 316, Short.MAX_VALUE)
                            .addContainerGap()))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanelDialogoModificarValoresMetodologiaLayout.createSequentialGroup()
                        .addComponent(jButtonAceptar)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jButtonCancelar)
                        .addContainerGap())))
        );
        jPanelDialogoModificarValoresMetodologiaLayout.setVerticalGroup(
            jPanelDialogoModificarValoresMetodologiaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelDialogoModificarValoresMetodologiaLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelDialogoModificarValoresMetodologiaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jButtonAceptar)
                    .addComponent(jButtonCancelar))
                .addContainerGap())
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanelDialogoModificarValoresMetodologia, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanelDialogoModificarValoresMetodologia, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

	private void cargarValoresMetodologia () {
		jTextFieldHorasSoftwarePequeño.setText (String.valueOf (vme.getHorasPorSoftwarePequeño ()));
		jTextFieldHorasSoftwareMediano.setText (String.valueOf (vme.getHorasPorSoftwareMediano ()));
		jTextFieldHorasModalidadUsuario.setText (String.valueOf (vme.getAumentoHorasPorModalidadUsuarios ()));
		jTextFieldHorasModalidadLugarEvaluacion.setText (String.valueOf (vme.getAumentoHorasPorModalidadLugarEvaluacion ()));
		jTextFieldPorcentajePeriodoEntregaSoftwarePequeño.setText (String.valueOf (vme.getPorcentajePorPeriodoEntregaVelozSoftwarePequeño ()));
		jTextFieldPorcentajePeriodoEntregaSoftwareMediano.setText (String.valueOf (vme.getPorcentajePorPeriodoEntregaVelozSoftwareMediano ()));
		jTextFieldPorcentajePeriodoEntregaSoftwareGrande.setText (String.valueOf (vme.getPorcentajePorPeriodoEntregaVelozSoftwareGrande ()));

	}

	private void jButtonAceptarActionPerformed (java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonAceptarActionPerformed

		vme.setHorasPorSoftwarePequeño (Integer.parseInt (jTextFieldHorasSoftwarePequeño.getText ()));
		vme.setHorasPorSoftwareMediano (Integer.parseInt (jTextFieldHorasSoftwareMediano.getText ()));
		vme.setAumentoHorasPorModalidadUsuarios (Integer.parseInt (jTextFieldHorasModalidadUsuario.getText ()));
		vme.setAumentoHorasPorModalidadLugarEvaluacion (Integer.parseInt (jTextFieldHorasModalidadLugarEvaluacion.getText ()));
		vme.setPorcentajePorPeriodoEntregaVelozSoftwarePequeño (Double.parseDouble (jTextFieldPorcentajePeriodoEntregaSoftwarePequeño.getText ()));
		vme.setPorcentajePorPeriodoEntregaVelozSoftwareMediano (Double.parseDouble (jTextFieldPorcentajePeriodoEntregaSoftwareMediano.getText ()));
		vme.setPorcentajePorPeriodoEntregaVelozSoftwareGrande (Double.parseDouble (jTextFieldPorcentajePeriodoEntregaSoftwareGrande.getText ()));
		((VistaPrincipal) this.getParent ()).getPanelPaso1 ().recalcular ();
		this.setVisible (false);

	}//GEN-LAST:event_jButtonAceptarActionPerformed

	private void jButtonCancelarActionPerformed (java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonCancelarActionPerformed
		this.setVisible (false);
	}//GEN-LAST:event_jButtonCancelarActionPerformed
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jButtonAceptar;
    private javax.swing.JButton jButtonCancelar;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JPanel jPanelDialogoModificarValoresMetodologia;
    private javax.swing.JTextField jTextFieldHorasModalidadLugarEvaluacion;
    private javax.swing.JTextField jTextFieldHorasModalidadUsuario;
    private javax.swing.JTextField jTextFieldHorasSoftwareMediano;
    private javax.swing.JTextField jTextFieldHorasSoftwarePequeño;
    private javax.swing.JTextField jTextFieldPorcentajePeriodoEntregaSoftwareGrande;
    private javax.swing.JTextField jTextFieldPorcentajePeriodoEntregaSoftwareMediano;
    private javax.swing.JTextField jTextFieldPorcentajePeriodoEntregaSoftwarePequeño;
    // End of variables declaration//GEN-END:variables
}
